Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update metrics Result to be MetricResult #2241

Conversation

pitoniak32
Copy link
Contributor

@pitoniak32 pitoniak32 commented Oct 24, 2024

related to comment: #2221 (comment)

Changes

Make the MetricResult / MetricError consistent with LogResult / LogError, and TraceResult / TraceError

Another option could be to have all signals type be Result / Error, and determine which one is used from the module path metrics::Result<()> / metrics::Error?

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@pitoniak32 pitoniak32 force-pushed the refactor/update-util-result-type-naming branch from 8321fda to 46c6f62 Compare October 24, 2024 22:18
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 54.05405% with 51 lines in your changes missing coverage. Please review.

Project coverage is 79.5%. Comparing base (9382bfb) to head (1164f9a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-sdk/src/metrics/pipeline.rs 50.0% 13 Missing ⚠️
opentelemetry-otlp/src/metric.rs 0.0% 5 Missing ⚠️
opentelemetry-otlp/src/exporter/http/metrics.rs 0.0% 4 Missing ⚠️
opentelemetry-otlp/src/exporter/tonic/metrics.rs 0.0% 4 Missing ⚠️
opentelemetry-sdk/src/metrics/manual_reader.rs 0.0% 4 Missing ⚠️
opentelemetry-sdk/src/metrics/periodic_reader.rs 71.4% 4 Missing ⚠️
opentelemetry-stdout/src/metrics/exporter.rs 0.0% 4 Missing ⚠️
opentelemetry-otlp/src/exporter/http/mod.rs 0.0% 3 Missing ⚠️
opentelemetry-proto/src/transform/metrics.rs 0.0% 2 Missing ⚠️
opentelemetry-sdk/src/metrics/view.rs 60.0% 2 Missing ⚠️
... and 5 more
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2241   +/-   ##
=====================================
  Coverage   79.5%   79.5%           
=====================================
  Files        121     121           
  Lines      20941   20944    +3     
=====================================
+ Hits       16664   16669    +5     
+ Misses      4277    4275    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pitoniak32
Copy link
Contributor Author

@cijothomas as we discussed in #2221 I opened this to address one of the bullets brought up

@pitoniak32 pitoniak32 marked this pull request as ready for review October 24, 2024 23:13
@pitoniak32 pitoniak32 requested a review from a team as a code owner October 24, 2024 23:13
Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

edit: We can have a single, consolidated changelog after #1042.

this is consistent with LogResult and TraceResult
@pitoniak32 pitoniak32 force-pushed the refactor/update-util-result-type-naming branch from bb55188 to 2c0e00f Compare October 25, 2024 23:23
@pitoniak32
Copy link
Contributor Author

pitoniak32 commented Oct 25, 2024

edit: We can have a single, consolidated changelog after #1042.

so I should omit adding a changelog update on this pr in favor of waiting for 1042?

this is consistent with LogError and TraceError
@pitoniak32 pitoniak32 force-pushed the refactor/update-util-result-type-naming branch from 2c0e00f to 72a012c Compare October 25, 2024 23:35
Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. As discussed in the PR already, we need to re-evaluate custom Error types and only make the relevant ones as public.

@cijothomas cijothomas merged commit f3be05b into open-telemetry:main Oct 26, 2024
23 of 25 checks passed
@pitoniak32 pitoniak32 deleted the refactor/update-util-result-type-naming branch October 26, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants